import { request } from '@umijs/max';
import { IRes, IResPage } from '.';

export interface IBusinessBanner {
  id: number;
  url: string;
}

export async function apiGetBusinessBannerList() {
  return request<IResPage<IBusinessBanner>>('/v1/business/banner/list', {
    method: 'GET',
  });
}

export async function apiGetBusinessBannerSave(
  params: Partial<IBusinessBanner>,
) {
  return request<IRes<IBusinessBanner>>('/v1/business/banner/save', {
    method: 'POST',
    data: params,
  });
}

export async function apiGetBusinessBannerDelete(id: number) {
  return request<IRes<boolean>>(`/v1/business/banner/${id}`, {
    method: 'DELETE',
  });
}
